The Raster Package ('rpck') Resource
The raster package ('rpck'
) resource, of typegxRasterPackType
, controls how bitmap data is packed into rasters for raster drivers. This resource is optional.Figure 6-24 shows the structure of a raster package resource.
Figure 6-24 The raster package resource
The raster package resource contains the following elements:
The ID of the raster package resource must be the constant
- Packaging buffer size. The number of bytes in the packing buffer. This value must be greater than or equal to the maximum number of bytes needed for one head pass on the printer.
- Number of color passes. The number of color passes required by the device to print an image. This value is typically 1 (for monochrome printers) or 4 (for CMYK printers).
- Height of print head. The height of the print head, in pixels.
- Passes per head height. The number of head passes required to achieve the height of the print head.
- Offset between passes. The offset, in pixels, between head passes.
- Flags. The raster package options, which can be combined together into a single value. The constants for the raster packing options are shown in Table 6-32.
gxRasterPackID
.
Listing 6-22 shows an example of a raster package resource for an ImageWriter II printer.Listing 6-22 An example of a raster package resource
resource gxRasterPackType (gxRasterPackID, sysHeap, purgeable) { 2500, /* ImageWriter packing buffer size */ 4, /* 4 color passes */ 16, /* print head is 16 pixels high */ 2, /* requires 2 passes to achieve 16 pixels */ 1, /* 1 pixel difference between passes */ gxInterlaceColor /* use interlace to avoid contamination */ };This resource specifies that the ImageWriter II printer uses a packing buffer that is 2500 bytes long, which is long enough for the largest line packaged by the driver. Since the driver uses CMYK color, 4 passes are required to print an image. The print head is 16 pixels high, and it requires 2 printing passes to print 16 pixels of data.If you use the default implementation of the
GXRasterDataIn
message, you must define a raster package ('rpck'
) resource. TheGXRasterDataIn
message is described on page 4-97 in the chapter "Printing Messages" in this book.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help